<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 设置背景图片 */
        .background {
            width: 380px;
            height: 340px;
            color: white;
            background: url("../images/popups/detailsPane.png") !important;
            background-position: center !important;
            background-repeat: no-repeat !important;
            background-size: 100% 100% !important;
            padding-top: 40px;
        }

        /* 设置标题头 */
        #title {
            text-align: center;
            font-size: 26px;
            color: white;
        }

        /* 设置内容 */
        .content {
            box-sizing: border-box;
            width: 100%;
            height: 100%;
            text-align: center;
        }
        .item{
            width: 80%;
            margin: 40px auto;
        }
        .item div{
            display: inline-block;
            width: 30%;
            text-align: left;
        }
        .item div+div{
            width: 60%;
        }
    </style>
</head>

<body>
    <div class="background">
        <div id="title"></div>
        <div class="content">
            <div class="item">
                <div>所在楼层：</div>
                <div id="floor"></div>
            </div>
            <div class="item">
                <div>设备名称：</div>
                <div id="name"></div>
            </div>
            <div class="item">
                <div>设备位置：</div>
                <div id="position"></div>
            </div>
        </div>
    </div>
    <script>
        // 获取当前类别
        var title = GetParamValue('title');
        document.getElementById('title').innerHTML = title;
        // 获取设备名称
        var equipmentName = GetParamValue('name');
        document.getElementById('name').innerHTML = equipmentName;
        
        // 获取设备楼层
        var equipmentFloor = GetParamValue('floor')
        document.getElementById('floor').innerHTML = equipmentFloor;

        // 获取设备位置
        var equipmentPosition = GetParamValue('position')
        document.getElementById('position').innerHTML = equipmentPosition;

        // 获取传来的坐标
        var x = GetParamValue('x');
        var y = GetParamValue('y');
        var z = GetParamValue('z');

        function GetParamValue(findParam, defaultValue) {
            var arr = document.location.href.split("?");
            if (arr.length <= 1)
                return defaultValue;
            arr = arr[1].split("&");
            for (var i = 0; i < arr.length; i++) {
                if (arr[i].indexOf(findParam) == 0
                    && arr[i].indexOf("=") == findParam.length) {
                    arr = arr[i].split("=");
                    return decodeURI(arr[1]);
                }
            }
            return defaultValue;
        };
    </script>
</body>

</html>